/*    file: RtpDumpReader.h
 *    desc:
 *   
 * created: 2014-07-21 15:21:46
 *  author: zhengchuanjiang
 * company: 
 */ 


#if !defined RTPDUMPREADER_H_
#define RTPDUMPREADER_H_

#include "RtpDumpFormat.h"
#include <stdio.h>
#include "comn/TByteBuffer.h"
////////////////////////////////////////////////////////////////////////////

class RtpDumpReader
{
public:
    struct Packet
    {
        BYTE*   ptr;
        UINT16  length;
    };

public:
    RtpDumpReader();
    ~RtpDumpReader();

    bool open(const char* filename);
    bool isOpen();
    void close();

    bool read(Packet& pkt);

protected:
    bool checkFileFormat();

protected:
    FILE*   m_file;
    
    comn::ByteBuffer    m_buffer;

};

////////////////////////////////////////////////////////////////////////////
#endif //RTPDUMPREADER_H_

